package io.github.lee.jel.dao

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Query
import io.github.lee.core.dao.BaseRoomDao
import io.github.lee.jel.domain.po.JellyfinSession


@Dao
interface JellyfinSessionDao : BaseRoomDao<JellyfinSession> {


    @Query("SELECT * FROM JellyfinSession WHERE address = :address")
    fun queryByAddress(address: String): JellyfinSession?

    @Query("SELECT * FROM JellyfinSession WHERE current = 1")
    fun queryCurrentSession(): JellyfinSession?

    @Query("SELECT * FROM jellyfinsession")
    fun queryAll(): List<JellyfinSession>

}